/*
 * QApplicationAdapter.h  0.4.0 / Nov 17, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
#ifndef QAPPLICATIONADAPTER_H
#define QAPPLICATIONADAPTER_H

#include "Cute4jSwing.h"

#include "QFontSet.h"

// QApplicationAdapter Class. --------------------------------------------------

/*!
 * \brief QApplication Adapter.
 *
 * \author Slobodan Vrkacevic
 * \version 0.4.0
 */
class CUTE4J_EXPORT QApplicationAdapter : public QApplication
{
  Q_OBJECT
public:
  QApplicationAdapter(int &argc, char **argv);
public:
  void aboutCute4j(JNIEnv *env, jstring version, jstring date);
  void aboutQt(JNIEnv *env);
  bool setTranslation(JNIEnv *env, const QString &fileName);
  void removeTranslation(JNIEnv *env);
  void setStyleSheet(JNIEnv *env, jstring styleSheetText);
  void setOverrideCursor(JNIEnv *env, jint type);
  void changeOverrideCursor(JNIEnv *env, jint type);
  void restoreOverrideCursor(JNIEnv *env);
  void setFontSet(QFontSet *fontSet);
public:
  static int exec();
private slots:
  void aboutCute4jSlot(const QString &version, const QString &date);
  void setTranslationSlot(bool *succeed, const QString &fileName);
  void removeTranslationSlot();
  void setStyleSheetSlot(const QString &styleSheetText);
  void setOverrideCursorSlot(jint type);
  void changeOverrideCursorSlot(jint type);
  void restoreOverrideCursorSlot();
  void aboutToQuitSlot();
signals:
  void aboutCute4jSignal(const QString &version, const QString &date);
  void aboutQtSignal();
  void setTranslationSignal(bool *succeed, const QString &fileName);
  void removeTranslationSignal();
  void setStyleSheetSignal(const QString &styleSheetText);
  void setOverrideCursorSignal(jint type);
  void changeOverrideCursorSignal(jint type);
  void restoreOverrideCursorSignal();
private:
  QFontSet *m_fontSet;
private:
  static QTranslator *sm_translator;
};

#endif // QAPPLICATIONADAPTER_H
